home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 11⁄24⁄89 / 0109-Re InvalRgn in TView-Nov89 < prev    next >
Encoding:
Text File  |  1989-11-24  |  1.1 KB  |  45 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    4549772                         20-Nov-89        17:32
  4.  
  5. From:   SCHMUCKER1                      Schmucker, Kurt
  6.  
  7. To:     MID                             France, Dev, MID/Nautil
  8.  
  9. cc:     MACAPP.TECH$                    MacApp Technical
  10.  
  11. Sub:    Re: InvalRgn in TView
  12.  
  13. Etienne,
  14.  
  15.     For what it is worth, I also felt that an InvalRgn was a very useful
  16. addition to MacApp.  Here is the code I wrote  (it seems to work ok):
  17.  
  18. {$S ARes}
  19. PROCEDURE TMyView.InvalidRegion(rgn: RgnHandle);
  20. VAR
  21.    tempRgn:RgnHandle;
  22.    visRect:Rect;
  23.    viewRect:   VRect;
  24.  
  25. BEGIN
  26.    IF Focus
  27.    THEN BEGIN
  28.      { Get a rect in view coordinates representing the visible portion of the
  29. view }
  30.    SELF.GetVisibleRect(visRect);
  31.    SELF.QDToViewRect(visRect, viewRect);
  32.    VRectToRect(viewRect, visRect);
  33.  
  34.      { Find the intersection of the vis region and the desired inval region }
  35.    tempRgn := NewRgn;
  36.    RectRgn(tempRgn, visRect);
  37.    SectRgn(tempRgn, rgn, tempRgn);
  38.  
  39.    InvalRgn(tempRgn);
  40.  
  41.    DisposeRgn(tempRgn);
  42.     END;
  43. END; { TMyView.InvalidRect }
  44.  
  45.